<template>
  <div class="subjectScoreTable"> 
    <head-Menu></head-Menu>
    <div class="SSTContainer">
      <el-table :data="SSTList" height="610" style="width:calc(100% - 10px);">
        <el-table-column width='80px' label="排 名" show-overflow-tooltip>
          <template slot-scope="scope">{{scope.$index + 1}}</template>
        </el-table-column>
        <el-table-column label="学 号" prop="account" show-overflow-tooltip></el-table-column>
        <el-table-column label="姓 名" prop="username" show-overflow-tooltip></el-table-column>
        <el-table-column label="学科" prop="subject" show-overflow-tooltip></el-table-column>
        <el-table-column label="成 绩" prop="score" show-overflow-tooltip></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import headMenu from '../../components/headMenu.vue'
import { getSubjectScoreTable } from "../../api/user";
import { Toast } from "vant";
export default {
  data() {
    return {
      toSubjectScoreTable: [],
      SSTList: [],
    }
  },
  components: {
    headMenu
  },
  created() {
    this.toSubjectScoreTable = JSON.parse(sessionStorage.getItem('toSubjectScoreTable'))
    this.getSubjectScoreTable()
  },
  methods: {
    async getSubjectScoreTable() {
      await getSubjectScoreTable(this.toSubjectScoreTable)
        .then((res) => {
          this.SSTList = res.SSTList
        })
    },
  },
}
</script>

<style lang='stylus'>
.subjectScoreTable
  flex 1 1 100%
  display block
  .SSTContainer
    margin 0 10px
    border 1px solid #CCCCCC  
    text-align center
</style>